<@pp.dropOutputFile/>

<#-- generate package name -->

<#-- iterate table list-->
<#function isString jdbcType>
	<#assign jdbcType = jdbcType?lower_case>
	<#if jdbcType?contains("char") || jdbcType?contains("time") || jdbcType?contains("date")>
		<#return true>
	<#else>
		<#return false>
	</#if>
</#function>

<#list doc.tables as table>
<#assign module = doc.artifactid?replace(".", "/") + "/" + table.moduleid?uncap_first>
<#assign fileName = table.name?cap_first>
<#assign data_url = "/" + module + "/" + fileName + "/">
<@pp.changeOutputFile name="/main/webapp/" + module + "/" + fileName + "/sequence.ftl"/>
<#noparse>
<#if data?exists>		
	<#list data as o>
	{
	</#noparse>
		<#list table.fields as field>
		"obj.${field.name}" : <#if isString(field.type)>"<#noparse><#if </#noparse>o.${field.name}<#noparse>?exists>${</#noparse>o.${field.name}}<#noparse></#if></#noparse>"<#else><#noparse><#if </noparse>o.${field.name}<#noparse>?exists>${o.</#noparse>${field.name}}<#noparse><#else>""</#if></#noparse></#if><#if field_has_next>,</#if>
		</#list><#noparse>
	}<#if o_has_next>,</#if>
	</#list>
</#if>
</#noparse>
</#list>
